matrix = [
    [1, 2, 3, 4],
    [5, 6, 7, 8],
    [9, 10, 11, 12],
 ]

list2 = [[row[i] for row in matrix] for i in range(4)]
print(list2)

transposed = []
for i in range(4):
    transposed.append([row[i] for row in matrix])
print(transposed)

new_list = []
for i in range(4):
     # the following 3 lines implement the nested listcomp
     transposed_row = []
     for row in matrix:
         transposed_row.append(row[i])
     new_list.append(transposed_row)

print(new_list)